<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>

<form:form commandName="logs" cssClass="form-horizontal" role="form">
	<c:if test="${not empty logs}">
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" style="color: #761c19">督查要求列表:</label>
		</div>
	</c:if>
	<c:forEach items="${logs}" var="logs" >
		<div class="form-group">
			<label class="col-sm-1 control-label no-padding-right">时间</label>
			<div class="col-sm-2">
				<input type="text"  value="${logs.dataTime}" readonly="readonly" class="form-control " >
			</div>

			<label class="col-sm-1 control-label no-padding-right" >任务时限</label>
			<div class="col-sm-2">
				<c:choose>
					<c:when test="${not empty logs.deadline}">
						<input type="number" readonly="readonly" value="${logs.deadline}" maxlength="2" min="1" max="99"
							   class="form-control ">
					</c:when>
					<c:otherwise>
						<input type="number" readonly="readonly" placeholder="无" value="${logs.deadline}" maxlength="2"
							   min="1" max="99" class="form-control ">
					</c:otherwise>
				</c:choose>
			</div>

			<label class="col-sm-1 control-label no-padding-right">督查方式</label>
			<div class="col-sm-3">
				<input type="text" title="${logs.methodName}" value="${logs.methodName}" readonly="readonly"
					   placeholder="请输入项目进展"  class="form-control" >
			</div>

			<div class="col-sm-2">
				<button type="button" class="btn btn-sm btn-primary downloadFile" data-id="${logs.taxproof}" style="width: 100%;">下载附件</button>
			</div>

		</div>

		<div class="form-group">

			<label class="col-sm-1 control-label no-padding-right">督查记录</label>
			<div class="col-sm-5">
				<textarea  rows="2"  class="form-control"  placeholder="请输入项目进展"   readonly="readonly">${logs.record}</textarea>
			</div>
			<label class="col-sm-1 control-label no-padding-right" >督查要求</label>
			<div class="col-sm-5">
				<textarea  rows="2"  class="form-control"  placeholder="督查要求" readonly="readonly">${logs.supervisionAsk}</textarea>
			</div>
		</div>

		<hr width="100%;height:2px;">

	</c:forEach>
	<form:hidden path="sysId"/>
</form:form>
<script type="text/javascript">
    /**
     * 下载
     */
     $(".downloadFile").click(function () {
         var id = $(this).data("id");
         var url = "/communal/download/" + id;
         window.open(url);
     });

    jQuery(function($) {
        $('.date-picker').datepicker({
            inline: true,
            format:"yyyymmdd",
            autoclose: true,
            todayHighlight: true,
            language: 'cn'
        })
        //show datepicker when clicking on the icon
            .next().on(ace.click_event, function(){
            $(this).prev().focus();
        });


        $(".downloadFile").each(function(){
            if(isEmpty($(this).data("id"))){
                $(this).attr("style","display:none;");
            }
        });
    });

    //更新操作
    $("#showDetail").click(function () {
        showEditView();
    });
</script>